import request from '@/utils/request'
import type { LoginForm, RegisterForm, User } from '@/types'

export const authAPI = {
  // 用户注册
  register: (data: RegisterForm): Promise<void> => {
    return request.post('/auth/register', data)
  },

  // 用户登录
  login: (data: LoginForm): Promise<{ token: string; message: string }> => {
    return request.post('/auth/login', data)
  },

  // 获取用户信息
  getProfile: (): Promise<User> => {
    return request.get('/auth/profile')
  },
}
